﻿package core.ui.dialogs
{
    import core.enum.*;
    import core.event.*;
    import core.image.*;
    import core.ui.controls.*;

    public class PointinizeDialog extends BitmapOperationDialogBase
    {
        var f:Filter;
        var b:Slidebar;
        var m:Slidebar;
        var cb:Checkbox;
        var type:Dropdown;

        public function PointinizeDialog(param1:Tuyitu)
        {
            super(param1, "rm_pointinize", 240, 130, Action.PointinizeFilter);
            this.f = new Filter();
            this.type = new Dropdown(180, 180);
            this.type.addEventListener(SelectEvent.COMMAND, this.Change);
            this.type.x = 20;
            this.type.y = 35;
            this.type.AddItem(U.RM("rm_squares"), "0");
            this.type.AddItem(U.RM("rm_large_circles"), "1");
            this.type.AddItem(U.RM("rm_small_circles"), "2");
            this.type.AddItem(U.RM("rm_dots"), "3", true);
            this.type.Bind();
            addChild(this.type);
            return;
        }// end function

        override public function Change(... args) : void
        {
            if (!locked)
            {
                bm.copyPixels(bc, bm.rect, bm.rect.topLeft);
                this.f.Pointinize(bm, bc, int(this.type.value), selection, offset);
            }
            return;
        }// end function

    }
}
